1. Field of the Invention
The present invention relates to a method of synchronizing a second communications means in a battery attached to an electronic device to a first communications means in said electronic device, wherein bytes consisting of a number of bits are transmitted between said electronic device and said battery by means of said first and second communications means using digital, serial communication. The invention further relates to a corresponding apparatus and a corresponding battery.
2. Description of the Related Art
In recent years the cellular telephone technology has developed rapidly and thus created a similar need for development in the area of batteries and battery packs, and more specifically, for communicating between a battery and an electronic device, such as a cellular telephone. Cellular telephones must utilize batteries in order to provide mobile capabilities. The battery is critical to the user of a cellular telephone, since the battery provides the ability to move about freely without being tied to a stationary power source.
Thus, in order to maximize the use of a cellular telephone, and other portable electronic devices, it is important that a user achieves maximum performance from the attached battery. This may be achieved by correctly charging the battery and always being able to identify the exact charging status of the battery. This enables the user to know how much standby time is left on the phone. This type of information enables the user to intelligently decide whether the charge in a battery is sufficient for his needs, or whether charging of the battery is required.
Recent developments of battery and battery pack related technologies have provided users with so-called xe2x80x9csmartxe2x80x9d batteries which can provide a user with a power source for an electronic device and further provide data transmission capabilities between the battery and the attached electronic device. This type of batteries may contain storage means adapted to store various data representing information which may be presented to a user, e.g. in a display of the portable device. The information in a battery can include different information such as an identification number, the maximum capacity, the present capacity, and other relevant information.
Some information from the battery is only used internally in the portable electronic device, while other information from the battery can be presented to the user, e.g. after having been processed by a processor in the battery or in the portable electrical device. For example, the stored information about the maximum capacity of the battery may be used in the electronic device only, while the present capacity may be calculated by the electronic device using the maximum capacity (or a previous value of the present capacity) and knowledge about the power consumption of the electronic device.
Therefore data is exchanged between the electronic device and the battery. This data exchange is normally performed using means enabling digital, serial asynchronous communication over an interface between communications means in the electronic device and communications means in the battery.
When using batteries which hold a number of different data, it is of interest to use bi-directional communications means enabling data to be transmitted in both directions. For example when the electronic device acts as a master and the battery as a slave, the electronic device can retrieve desired information by sending a command to the battery and receive data from the battery in response.
In order to communicate, the communications means in the electronic device and the communications means in the battery have to be synchronized as there is an absolute limit for the acceptable timing variations between these communications when the transmitted signals have to be received correctly. The baud rate of serial asynchronous communication in compact systems is often fixed. This implies that both units need exact crystals to ensure stable timing. This has the drawback of being an expensive solution and is therefore normally of no interest in relation to portable electronic devices and batteries where the price is an important parameter. Further, the use of crystals in batteries when minimizing the size of batteries is of interest.
The object of the invention is to provide a method of the above-mentioned type which is simpler and cheaper compared to methods according to the prior art.
This object is achieved according to the invention by a method in which a predetermined bit sequence is appended to at least some bytes prior to the transmission from said first communications means to said second communications means, said bit sequence is detected in the signal received by said second communication means, the time interval between given shifts in the detected bit sequence is measured, and said synchronization is performed by means of said measured time interval.
Hereby, as synchronization based on said measured time interval can be performed continuously, a baud rate timing can be performed in the battery by use of less stable, simpler and less expensive oscillation circuits compared to the use of expensive crystals according to the prior art.
Preferably, said appended bit sequence is transmitted prior to the transmission of the remaining bits in said byte, and said synchronization is performed prior to receiving said remaining bits.
Preferably, said bit sequence includes two bits of different value, and said time interval is specified by a shift defining the beginning of the first bit and a shift between said two bits. By reducing the amount of bit appended bytes used for synchronizing purposes the amount of bits to be transmitted is reduced.
Preferably, every one of said bytes includes said appended predetermined bit sequence. As a result, the synchronization can be performed each time a byte is received.
In another embodiment at least one of said bytes does not include an appended predetermined bit sequence. Hereby the total amount of bits transmitted can be reduced.
As mentioned, the present invention also relates to an apparatus comprising an electronic device, a battery attached thereto, means enabling digital, serial communication over an interface between the electronic device and the battery, and comprising first communications means in the electronic device and second communications means in the battery, said digital, serial communication comprising transmission of bytes consisting of a number of bits between said first and second communications means.
In an apparatus according to the invention said first communications means is adapted to append a predetermined bit sequence having at least two shifts to at least some bytes prior to the transmission to said second communications means, said second communications means are further adapted to detect said bit sequence in a received signal, to measure the time interval between given shifts in said bit sequence, and to synchronize said second communications means to said first communications means by means of said measured time interval.
Hereby, as synchronization based on said measured time interval can be performed continuously, a baud rate timing can be performed in the battery by means of less stable, simpler and less expensive oscillation circuits compared to the use of expensive crystals according to the prior art.
In accordance with one embodiment, said first communications means is adapted to transmit said appended bit sequence prior to the transmission of the remaining bits in said byte, and said second communications means is adapted to perform said synchronization prior to receiving said remaining bits. Hereby it is ensured said second communications means has just been synchronized to said first communications means when the remaining bits are received.
Preferably, said first communications means is adapted to append a predetermined bit sequence including two bits of different values, and that said second communications means is adapted to perform said synchronization based on a time interval specified by a shift defining the beginning of the first bit and a shift between said two bits. By reducing the amount of bit appended bytes used for synchronizing purposes the amount of bits to be transmitted is reduced.
In accordance with a preferred embodiment, said first communications means is adapted to append said predetermined bit sequence to every one of said bytes.
In accordance with another preferred embodiment, said first communications means is adapted to append said predetermined bit sequence to some of said bytes while other bytes are not appended to said predetermined bit sequence.
Preferably, said electronic device is a cellular telephone.
The present invention further relates to a battery comprising means enabling digital, serial communication over an interface between the battery and an electronic device, and comprising communications means in the battery, said digital, serial communication comprising transmission of bytes consisting of a number of bits to and from said communication means.
In a battery according to the invention said communications means includes synchronization means adapted to detect a predetermined bit sequence in a received byte, to measure the time interval between given shifts in said bit sequence, and to synchronize said communication means in accordance with the measured time interval. Hereby the communications means of the battery can be syncronized in accordance with a received signal, resulting in a simpler and less expensive solution compared to the prior art.